<template>
	<view class="container">
		<!-- 居中卡片 -->
		<view class="card">
			<!-- 按钮容器 -->
			<view class="button-group">

				<u-button type="" style="width: 100%;height: 100%;" text="主要按钮" @click="handlePrimary"   v-if="type!=2">

					<view class="contleft">
						<u-icon name="/static/icon/guahao.png" size="100"></u-icon>
					</view>
					<view class="contright">
						<span class="conta">门诊挂号</span>
						<span class="contb">找专家&emsp;快速预约</span>
					</view>

				</u-button>





				<u-button type="" text="成功按钮" @click="handleSuccess"
					style="margin-top: 20rpx;width: 100%;height: 100%;"  v-if="type!=1">
					<view class="contleft">
						<u-icon name="/static/icon/tijian.png" size="100"></u-icon>
					</view>
					<view class="contright">
						<span class="conta">预约体检</span>
						<span class="contb">体检预约&emsp;快速预约</span>
					</view>



				</u-button>
			</view>
		</view>
	</view>
	<image src="/static/icon/yisheng.png" mode="widthFix" class="fixed-image"></image>
</template>

<script>
	export default {


		data() {
			return {
				type: "",

			}
		},
		onLoad() {
			this.type = window.location.href.split("=")[1].split("#")[0]
		},
		methods: {
			handlePrimary() {
				uni.navigateTo({
					url: "/pages/newregister/selectDepartment/selectDepartment",
					fail(error) {
						console.log(error)
					}
				})
			},
			handleSuccess() {
				uni.navigateTo({
					url: "/pages/MedicalExamination/MedicalExaminationNew",
					fail(error) {
						console.log(error)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100vh; // 满屏高度
		background-color: #f5f5f5;
	}

	.card {
		width: 80%;
		padding: 40rpx;
		background-color: #ffffff;
		border-radius: 16rpx;
		box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.1);

		// 卡片动画（可选）
		animation: cardEnter 0.6s ease;
	}

	.button-group {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.fixed-image {
		position: fixed;
		left: 30rpx;
		bottom: 30rpx;
		z-index: 999;
		width: 50%;
		height: 50%;
		opacity: 0.8;
		// transition: all 0.3s;

		/* 适配iPhoneX等有底部安全区域的设备 */
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);


	}

	@keyframes cardEnter {
		from {
			transform: translateY(60rpx);
			opacity: 0;
		}

		to {
			transform: translateY(0);
			opacity: 1;
		}
	}
</style>
<style>
	@import './index.css';
</style>